package com.cn.ccp.action.system;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.faces.context.FacesContext;

import com.cn.ccp.action.BaseAction;
import com.cn.ccp.bean.MenuBean;
import com.cn.ccp.bean.UserBean;

public class MenuOperatBean extends BaseAction{

	private List<MenuBean> menuList ;

	public List<MenuBean> getMenuList() {
		Map sessionmap=FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
		menuList = new ArrayList<MenuBean>();
		if(sessionmap.containsKey("userBean")){
			UserBean bean = (UserBean) sessionmap.get("userBean");
			menuList = getMenuService().getMenuListByUserID(""+bean.getId());
		}
		return menuList;
	}

	public void setMenuList(List<MenuBean> menuList) {
		this.menuList = menuList;
	}
	
}
